package com.aizuda.boot.modules.business.negotiation.service;

import com.aizuda.boot.modules.business.contract.dto.SingleResponse;
import com.aizuda.boot.modules.business.filling.domain.request.PageQuery;
import com.aizuda.boot.modules.business.negotiation.entity.ContractNegotiationConfigEntity;
import com.aizuda.boot.modules.business.negotiation.entity.dto.NegotiationConfigSaveDTO;
import com.aizuda.boot.modules.business.negotiation.entity.dto.NegotiationConfigUpdateDTO;
import com.aizuda.boot.modules.business.negotiation.entity.vo.NegotiationConfigShowDTO;
import com.aizuda.boot.modules.business.negotiation.entity.vo.NegotiationShowListDTO;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.service.IService;

/**
 * @Author sangyirong
 * @ClassName ContractNegotiationConfigService
 * @Version 1.0
 * @Date 2025/6/28 15:05
 */
public interface ContractNegotiationConfigService extends IService<ContractNegotiationConfigEntity> {


    /**
     * 查询协商配置列表
     * @return
     */
    SingleResponse<IPage<NegotiationShowListDTO>> getNegotiationShowList(PageQuery query);

    /**
     * 保存协商配置
     * @param negotiationConfigSaveDTO
     * @return
     */
    SingleResponse<NegotiationConfigShowDTO> saveNegotiationConfig(NegotiationConfigSaveDTO negotiationConfigSaveDTO);

    /**
     * 更新协商配置
     * @param negotiationConfigUpdateDTO
     * @return
     */
    SingleResponse updateNegotiationConfig(NegotiationConfigUpdateDTO negotiationConfigUpdateDTO);

    /**
     * 删除协商配置
     * @param id
     * @return
     */
    SingleResponse deleteNegotiationConfig(Long id);

    /**
     * 获取协商配置
     *
     * @param id
     * @return
     */
    SingleResponse<NegotiationConfigShowDTO> getNegotiationConfig(Long id);


    /**
     * 更新状态
     * @param id
     * @return
     */
    SingleResponse updateStatus(Long id);

    /**
     * 根据合同类型选择最优协商配置的流程ID
     *
     * @param contractTypeId 合同类型ID
     * @param applicantDepartmentId 申请人部门ID（已废弃，保留参数以兼容现有调用）
     * @return 最优协商配置的流程ID，如果没有找到返回null
     */
    Long selectOptimalNegotiationProcessId(Integer contractTypeId, Long applicantDepartmentId);
}
